<script setup lang="ts">
import {useRoute} from "vue-router";
import {computed} from "vue";
import {useUserStore} from "@/store/user.ts";
import {storeToRefs} from "pinia";

const userStore = useUserStore();
const {getUserInfo,userInfo} = storeToRefs(userStore);
const sysUser = getUserInfo;

const route = useRoute();
// 获取路由路径参数,计算属性（相当于缓存）
const id = computed(() => route.params.id);

</script>

<template>
  <div>
    用户管理
  </div>
  <div>
    路由路径参数ID: {{id}}
  </div>
  <div>
    <h1>获取登录后的store保存的用户信息：</h1>
    用户ID: {{sysUser?.id}},
    账号信息: {{sysUser?.account}},
    用户名: {{sysUser?.realName}}
  </div>
</template>

<style scoped>

</style>